#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
#include<math.h>
int main()
{
    int flag = 0;
    int n = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
    {
        int k = 0;
        scanf("%d", &k);
        int key = sqrt(k);
        for (int j = 2; j < key; j++)
        {
            if (key % j == 0)
            {
                printf("false\n");
                break;
            }
            if (j == key)
            {
                printf("true\n");
                break;
            }
            if (key == 1)
            {
                printf("false\n");
                break;
            }   
        }
    }
    return 0;
}

